Home:ALL Converter>Not able to run nodemon (SyntaxError: Unexpected token) on ubuntu

Not able to run nodemon (SyntaxError: Unexpected token) on ubuntu

Ask Time:2022-01-18T14:03:12         Author:laser

Json Formatter

command I am running : nodemon server.js, error I am getting :

nodemon server.js
/usr/local/lib/node_modules/nodemon/node_modules/update-notifier/index.js:58
            } catch {
                    ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/nodemon/bin/nodemon.js:15:3)

I tried various ways of installing nodemon on Ubuntu but still getting exact same error every time I run.

Author:laser,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70750949/not-able-to-run-nodemon-syntaxerror-unexpected-token-on-ubuntu
yy